package com.turing.post.organization.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 商圈绑定商户
 * 
 * @author zxp
 * @Dec 18, 2012
 */
@Remote
@Local
public interface BusinessDistrictMerchantDao {

	/**
	 * 根据主键查询商圈绑定商户
	 * 
	 * @param businessDistrictMerchant
	 *            商圈绑定商户
	 * @return BusinessDistrictMerchant 商圈绑定商户
	 */
	public BusinessDistrictMerchant getBusinessDistrictMerchantByPrimaryKey(
			BusinessDistrictMerchant businessDistrictMerchant);

	/**
	 * 新增商圈绑定商户
	 * 
	 * @param businessDistrictMerchant
	 *            商圈绑定商户
	 * @throws PCPSApplicationException
	 */
	public void insertBusinessDistrictMerchant(
			BusinessDistrictMerchant businessDistrictMerchant)
			throws PCPSApplicationException;

	/**
	 * 修改商圈绑定商户
	 * 
	 * @param businessDistrictMerchant
	 *            商圈绑定商户
	 * @throws PCPSApplicationException
	 */
	public void updateBusinessDistrictMerchant(
			BusinessDistrictMerchant businessDistrictMerchant)
			throws PCPSApplicationException;

	/**
	 * 查询商户已绑定的商圈
	 * 
	 * @param merchantNo
	 * @return
	 */
	public List<BusinessDistrictMerchant> getBusinessDistrictMerchantListByMerchantNo(
			String merchantNo);

	/**
	 * 商户绑定商圈
	 * 
	 * @param bdmList
	 */
	public void insertBusinessDistrictMerchantByList(String merchantNo,
			BigInteger[] arrInt) throws PCPSApplicationException;

	/**
	 * 删除商户下所有绑定的商圈
	 * 
	 * @param merchantNo
	 */
	public void deleteBusinessDistrictMerchantByMerchantNo(String merchantNo);

	/**
	 * 登录所属发卡商下列表
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @param page
	 *            分页
	 * @return List 商圈绑定商户列表
	 */
	public List<BusinessDistrictMerchant> getBusinessDistrictMerchantList(
			PCPSWebInput webInput, Integer page);

	/**
	 * 登录所属发卡商下记录数
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @return BigInteger 记录数
	 */
	public BigInteger getBusinessDistrictMerchantTotal(PCPSWebInput webInput);

	/**
	 * 根据商圈编号查询商户列表
	 * @param businessDistrictId
	 * @return
	 */
	public List<BusinessDistrictMerchant> getBusinessDistrictMerchantListByBusinessDistrictId(
			BigInteger businessDistrictId);

	/**
	 * 插入商圈绑定商户
	 * @param bdmList
	 * @throws PCPSApplicationException
	 */
	public void insertBusinessDistrictMerchantByList(BigInteger businessDistrictId,
			List<BusinessDistrictMerchant> bdmList)
			throws PCPSApplicationException;
	
	/**
	 * 根据商户号获取商圈列表
	 * @param branchNo
	 * @return
	 */
	public List<BusinessDistrict> getBusinessDistrictByBranchNO(String branchNo);
}
